#include "stdafx.h"
#include "ParticleSystem.h"
#include "ParticleEmitter.h"
#include "ParticleEffector.h"

ParticleSystem::ParticleSystem(void)
{
}

/*virtual*/ ParticleSystem::~ParticleSystem(void)
{
	for (unsigned int i = 0; i < emitters.size(); i++)
		delete emitters[i];
}

/*virtual*/ void ParticleSystem::Update(float dt) /*override*/
{
	for (unsigned int i = 0; i < emitters.size(); i++)
		emitters[i]->Update(dt);
}

/*virtual*/ void ParticleSystem::Draw(void) /*override*/
{
	for (unsigned int i = 0; i < emitters.size(); i++)
		emitters[i]->Draw();
}

void ParticleSystem::AddEmitter(ParticleEmitter* emitter)
{
	emitter->parent = this;
	emitters.push_back(emitter);
}